]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Synchronize input method state after toggling completion
authorCarlos Garnacho <carlosg@gnome.org>
Mon, 17 Oct 2022 11:31:45 +0000 (13:31 +0200)
committerMarge Bot <marge-bot@gnome.org>
Wed, 26 Oct 2022 10:00:37 +0000 (10:00 +0000)
Make the input method synchronize its state after the engine changes
resulting from completion being toggled.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2512>

js/misc/inputMethod.js
js/ui/keyboard.js

index d9335cc81913aec7fa1049c83ead76871a82171e..07c177b81750f912470ab5c916f27e7b36a6d81b 100644 (file)
@@ -352,4 +352,15 @@ var InputMethod = GObject.registerClass({
             return false;
         }
     }
+
+    update() {
+        if (!this._context)
+            return;
+        this._updateCapabilities();
+        this._context.set_content_type(this._purpose, this._hints);
+        this._context.set_cursor_location(
+            this._cursorRect.x, this._cursorRect.y,
+            this._cursorRect.width, this._cursorRect.height);
+        this._emitRequestSurrounding();
+    }
 });
index 3241571de7e45c7655085371451e26ac27ae5dc6..a158425a68b9165bb4379d576f1d5f0361d4f4fa 100644 (file)
@@ -1893,7 +1893,7 @@ var Keyboard = GObject.registerClass({
         }
 
         this._oskCompletionEnabled =
-            IBusManager.getIBusManager().setCompletionEnabled(true);
+            IBusManager.getIBusManager().setCompletionEnabled(true, () => Main.inputMethod.update());
         this._clearKeyboardRestTimer();
 
         if (immediate) {
@@ -1928,7 +1928,7 @@ var Keyboard = GObject.registerClass({
         if (!this._keyboardVisible)
             return;
 
-        IBusManager.getIBusManager().setCompletionEnabled(false);
+        IBusManager.getIBusManager().setCompletionEnabled(false, () => Main.inputMethod.update());
         this._oskCompletionEnabled = false;
         this._clearKeyboardRestTimer();